using System;
using System.Collections.Generic;
using System.Text;
using System.Drawing;

namespace MapEditor
{
    public static class MathUtils
    {
        public static double GetDistance(Point Origin, Point Destination)
        //get the distance between two points - integer values
        {
            //use pythagoras to return num of pixels
            double Distance = Math.Sqrt(Math.Pow(Math.Abs(Origin.X - Destination.X), 2) + Math.Pow(Math.Abs(Origin.Y - Destination.Y), 2));
            return Distance;

        }

        public static double GetDistance(dPoint Origin, Point Destination)
        //get the distance between two points - integer values
        {
            //use pythagoras to return num of pixels
            double Distance = Math.Sqrt(Math.Pow(Math.Abs(Origin.X - Destination.X), 2) + Math.Pow(Math.Abs(Origin.Y - Destination.Y), 2));
            return Distance;

        }

        public static double GetDistance(dPoint Origin, dPoint Destination)
        //get the distance between two points - integer values
        {
            //use pythagoras to return num of pixels
            double Distance = Math.Sqrt(Math.Pow(Math.Abs(Origin.X - Destination.X), 2) + Math.Pow(Math.Abs(Origin.Y - Destination.Y), 2));
            return Distance;

        }


        public static double GetAngle(Point startPos, Point endPos)
            //get the angle between two points
        {
            double NeedAngle = Math.Atan2((endPos.Y - startPos.Y), (endPos.X - startPos.X)) * (180 / Math.PI);
            if (NeedAngle < 0)
            {
                NeedAngle += 360;
            }
            return NeedAngle;

        }

        public static double GetAngle(dPoint startPos, Point endPos)
        {
            double NeedAngle = Math.Atan2((endPos.Y - startPos.Y), (endPos.X - startPos.X)) * (180 / Math.PI);
            if (NeedAngle < 0)
            {
                NeedAngle += 360;
            }
            return NeedAngle;
        }

        public static void GetOffsetPosition(Point startLocation, double angle, double distanceToMove, ref double X, ref double Y)

        {
        
        }
    }
}
